﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="updateuser.aspx.cs" Inherits="test_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>无标题页</title>
</head>
<body>
    <form id="form1" runat="server">  
    <table width="872" border="0" cellspacing="0" id="table1" class="font33">
        <tr>
            <td style="width: 969px">
                <table border="0" cellspacing="0" style="width: 794px">
                    <tr>
                        <td>
                            <table width="700" border="0" cellspacing="0">
                                <tr>
                                    <td width="189" class="font33">
                                        <asp:Label ID="Label3" runat="server" Height="24px" Text="选择机构：" Width="78px" Font-Bold="True"></asp:Label>
                                    </td>
                                    <td width="507" class="font33">
                                        <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource2"
                                            DataTextField="jigou" DataValueField="jigou" Width="272px" 
                                            onselectedindexchanged="DropDownList1_SelectedIndexChanged">
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 115px; height: 24px;" class="font33">
                                        <asp:Label ID="Label21" runat="server" Height="24px" Text="角色、用户名或姓名：" Width="150px"
                                            Font-Bold="True"></asp:Label>
                                    </td>
                                    <td style="width: 277px; height: 24px;" class="font33">
                                        <asp:TextBox ID="TextBox1" runat="server" Height="15px" Width="116px"></asp:TextBox>
                                        <asp:Button ID="btnExec" runat="server" Text="执行" Height="21px" Width="79px" OnClick="btnExec_Click" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                            <asp:GridView ID="GridView2" runat="server" AllowPaging="True" AllowSorting="True"
                                AutoGenerateColumns="False" DataSourceID="SqlDataSource1" DataKeyNames="username,id"
                                PageSize="8" Width="867px" CellPadding="4" ForeColor="Black" GridLines="Vertical"
                                OnRowCommand="GridView2_RowCommand" BackColor="White" 
                                BorderColor="#DEDFDE" BorderStyle="None"
                                BorderWidth="0px" CssClass="font33" 
                                OnPageIndexChanged="GridView2_PageIndexChanged" 
                                onrowdatabound="GridView2_RowDataBound">
                                <Columns>
                                    <asp:BoundField DataField="id" HeaderText="序号" InsertVisible="False" SortExpression="id"
                                        ReadOnly="True" Visible="False" />
                                    <asp:HyperLinkField DataNavigateUrlFields="id" DataNavigateUrlFormatString="updateuser1.aspx?id={0}"
                                        DataTextField="username" DataTextFormatString="{0}(编辑)" 
                                        HeaderText="编辑用户信息" >
                                    <ItemStyle Wrap="False" />
                                    </asp:HyperLinkField>
                                    <asp:BoundField DataField="username1" HeaderText="姓名" 
                                        SortExpression="username1" >
                                    <ItemStyle Wrap="False" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="mobile" HeaderText="手机" SortExpression="mobile" />
                                    <asp:BoundField DataField="mail" HeaderText="信箱" SortExpression="mail" >
                                    <ItemStyle Wrap="False" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="role" HeaderText="身份" SortExpression="role" 
                                        ReadOnly="True" >
                                    <ItemStyle Wrap="False" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="city" HeaderText="所在城市" SortExpression="city" >
                                    <ItemStyle Wrap="False" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="gzdw" HeaderText="工作单位" SortExpression="gzdw" >
                                    <ItemStyle Wrap="False" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="jigou" HeaderText="所属机构" SortExpression="jigou" 
                                        ReadOnly="True" >
                                    <ItemStyle Wrap="False" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="xtsj1" HeaderText="注册时间" SortExpression="xtsj1" 
                                        ReadOnly="True" >
                                    <ItemStyle Wrap="False" />
                                    </asp:BoundField>
                                </Columns>
                                <FooterStyle BackColor="#CCCC99" />
                                <RowStyle BackColor="#F7F7DE" />
                                <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
                                <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
                                <HeaderStyle BackColor="#D9EDB2" Font-Bold="True" ForeColor="Black" 
                                    Font-Underline="False" Wrap="False" />
                                <AlternatingRowStyle BackColor="White" />
                            </asp:GridView>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                        </td>
                    </tr>
                </table>
                <br />
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:gConnectionString %>"
                    OldValuesParameterFormatString="original_{0}">
                    <%--SelectCommand="SELECT [id], [username], [username1], [mobile], [mail],  [gzdw], [jigou], [city],[xtsj1],[role], [chuzhi] FROM [account] WHERE ((([username] like '%'+@username+'%') OR ([username1] like '%'+@username+'%') OR ([role] like '%'+@username+'%')) AND ([role]!='管理员') AND ([jigou]=@jigou))">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="TextBox1" DefaultValue="%TextBox1.Text.Trim()%"
                            Name="username" PropertyName="Text" Type="String" />
                        <asp:ControlParameter ControlID="DropDownList1" Name="jigou" PropertyName="SelectedValue"
                            Type="String" />
                    </SelectParameters>--%>
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:gConnectionString %>"
                    SelectCommand="SELECT DISTINCT [jigou] FROM [account] WHERE (([role] = @role1) OR ([role] = @role2))">
                    <SelectParameters>
                        <asp:Parameter DefaultValue="机构" Name="role1" Type="String" />
                        <asp:Parameter DefaultValue="管理员" Name="role2" Type="String" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <asp:TextBox ID="TextBox2" runat="server" Width="523px" Visible="False"></asp:TextBox>
        </tr>
        <tr>
            <td style="width: 969px">
                &nbsp;
                <asp:Button ID="Button１" runat="server" Text="同步用户表" OnClick="Button2_Click" Visible="False" />&nbsp;&nbsp;
            </td>
        </tr>
    </table>
    <asp:TextBox ID="TextBox3" runat="server" Font-Size="XX-Small" Width="641px" Visible="False"></asp:TextBox>
</form>
</body>
</html>
